package p4_1;

public class QuadraticEquation 
{
	//Instance variables
	private double a=0;
	private double b=0;
	private double c=0;
	//Constructor
	public QuadraticEquation(double a, double b, double c)
	{
		this.a = a;
		this.b = b;
		this.c = c;
	}
	
	//Methods
	public boolean hasSolutions()
	{
		boolean result;
		if (b*b-4*a*c<0)
		{
			result = false;
		}
		else
		{
			result = true;
		}
		return result;
	}
	
	public double getSolutionOne()
	{
		double x = (-b-Math.sqrt(b*b-4*a*c))/(2*a);
		return x;
	}
	
	public double getSolutionTwo()
	{
		double x = (-b+Math.sqrt(b*b-4*a*c))/(2*a);
		return x;
	}
}
